package com.baor.controller;

import com.baor.domain.RoleVo;
import com.baor.service.RoleService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @RequestMapping("roleList")
    public AjaxResult<?> roleList(int pageIndex,int pageSize){
        return roleService.roleList(pageIndex, pageSize);
    }

    @RequestMapping("searchRole")
    public AjaxResult<?> searchRole(@RequestBody Map<String,Object> param){
        return roleService.searchRole(param);
    }

    @RequestMapping("delete")
    public AjaxResult<?> delete(int roleId){
        return roleService.delete(roleId);
    }

    @RequestMapping("insertRole")
    public AjaxResult<?> insertRole(@RequestBody Map<String,Object> params){
        return roleService.insertRole(params);
    }
    @RequestMapping("hightRole")
    public AjaxResult<?> hightRole(){
        return roleService.highterRole();
    }
}
